from django.db import models

class LoginInfo(models.Model):
    key = models.CharField(max_length=5, primary_key=True)
    city_name = models.CharField(max_length=20, null=True)
    used_team = models.CharField(max_length=10, null=True)
    team_name = models.CharField(max_length=20, null=True)
    real_name = models.CharField(max_length=10, null=True)
    username = models.CharField(max_length=20)
    password = models.CharField(max_length=20)
    access_token = models.CharField(max_length=40, null=True)
    jsessionid = models.CharField(max_length=40, null=True)
    remark = models.CharField(max_length=20, null=True)

class Setting(models.Model):
    key = models.CharField(max_length=10, primary_key=True)
    value = models.CharField(max_length=50, null=True)
    remark = models.CharField(max_length=20, null=True)

class TaskDayReport(models.Model):
    date = models.CharField(max_length=10, null=True)
    task_name = models.CharField(max_length=255, null=True)
    city_name = models.CharField(max_length=5, null=True)
    team_name = models.CharField(max_length=20, null=True)
    team_name_hd = models.CharField(max_length=5, null=True)
    taskType = models.CharField(max_length=10, null=True)
    call_count = models.CharField(max_length=10, null=True)
    call_get_count = models.CharField(max_length=10, null=True)
    suc_count = models.CharField(max_length=10, null=True)
    call_get_pc = models.CharField(max_length=10, null=True)
    suc_pc = models.CharField(max_length=10, null=True)
    user_count = models.CharField(max_length=10, null=True)

class TaskStates(models.Model):
    cityId = models.CharField(max_length=5, null=True)
    taskName = models.CharField(max_length=50, primary_key=True)
    deptName = models.CharField(max_length=20, null=True)
    createTime = models.CharField(max_length=20, null=True)
    totalNum = models.CharField(max_length=10, null=True)
    finishNum = models.CharField(max_length=10, null=True)
    leftNum = models.CharField(max_length=10, null=True)
    per = models.CharField(max_length=10, null=True)
    upDate = models.CharField(max_length=20, null=True)

class TaskType(models.Model):
    key = models.CharField(max_length=10, primary_key=True)
    textKey = models.CharField(max_length=255, null=True)

class TaskWant(models.Model): # 外呼计划
    cityId = models.CharField(max_length=5, null=True) # id
    wantDate = models.CharField(max_length=10, null=True) # 计划日期
    taskType = models.CharField(max_length=10, null=True)
    lessNum = models.CharField(max_length=10, null=True) # 
    wantCall = models.CharField(max_length=10, null=True)
    wantSuc = models.CharField(max_length=10, null=True)
    upTime = models.CharField(max_length=20, null=True)
    doCall = models.CharField(max_length=10, null=True)
    doCalled = models.CharField(max_length=10, null=True)
    doSuc = models.CharField(max_length=10, null=True)
    doJtl = models.CharField(max_length=10, null=True)
    doCgl = models.CharField(max_length=10, null=True)
    lessSuc = models.CharField(max_length=10, null=True)